/*
 *  Class: StdfField 
 *  Purpose: Represent the STDF rec data components
 *  
 */

#ifndef STDFFIELD_H_
#define STDFFIELD_H_

#include <string>
#include <iostream>
#include <vector>

using namespace std;

namespace opsrc {
	namespace stdf 	{
		

		template <typename T>  
		class StdfField {
		public:
			typedef T R;

                        static string dString;
		
			StdfField();
			StdfField(T repData, int Offset, int bytelength, int totalbytelength);
			StdfField(const StdfField &obj);
		
			virtual ~StdfField();
			
			void setOffset(int offset);
			int getOffset() const;
			
			int getByteCount() const;
			void setByteCount(int count);
			
			int getTotalByteCount() const;
			void setTotalByteCount(int tlen) ;
			
			T& getData() ;
			const T& getData() const;
			void setData(T d);
			
			void set(T d, int offset, int len, int tlen);

                        string getDataS() const;
	
		private:
		    T data;
		    int  offset;
		    int  length;  // length or count of bytes
		    int totallen;
				
		};

                // specialization for vector<unsigned int>

   		
		
	}	// namespace stdf
}	// opsrc
#endif /*STDFFIELD_H_*/
